package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.zidingyikongjian.R;

public class RouteAndTextActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_route_or_text);

        initView();
    }

    private void initView() {
        findViewById(R.id.btn_draw_line_route).setOnClickListener(this);
        findViewById(R.id.btn_draw_rect_route).setOnClickListener(this);
        findViewById(R.id.btn_draw_rect_text_route).setOnClickListener(this);
        findViewById(R.id.btn_round_rect_route).setOnClickListener(this);
        findViewById(R.id.btn_circle_route).setOnClickListener(this);
        findViewById(R.id.btn_oval_route).setOnClickListener(this);
        findViewById(R.id.btn_acr_route).setOnClickListener(this);
        findViewById(R.id.btn_text_route).setOnClickListener(this);
        findViewById(R.id.btn_text_skewX_route).setOnClickListener(this);
        findViewById(R.id.btn_text_ScaleX_route).setOnClickListener(this);
        findViewById(R.id.btn_text_position_route).setOnClickListener(this);
        findViewById(R.id.btn_text_draw_route).setOnClickListener(this);
        findViewById(R.id.btn_my_font_route).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_draw_line_route:
                goIntent(DrawRouteAndTextActivity.class, "1");
                break;
            case R.id.btn_draw_rect_route:
                goIntent(DrawRouteAndTextActivity.class, "2");
                break;
            case R.id.btn_draw_rect_text_route:
                goIntent(DrawRouteAndTextActivity.class, "3");
                break;
            case R.id.btn_round_rect_route:
                goIntent(DrawRouteAndTextActivity.class, "4");
                break;
            case R.id.btn_circle_route:
                goIntent(DrawRouteAndTextActivity.class, "5");
                break;
            case R.id.btn_oval_route:
                goIntent(DrawRouteAndTextActivity.class, "6");
                break;
            case R.id.btn_acr_route:
                goIntent(DrawRouteAndTextActivity.class, "7");
                break;
            case R.id.btn_text_route: // 三种文字
                goIntent(TextActivity.class, "8");
                break;
            case R.id.btn_text_skewX_route: // 斜体
                goIntent(TextActivity.class, "9");
                break;
            case R.id.btn_text_ScaleX_route: // 拉伸
                goIntent(TextActivity.class, "10");
                break;
            case R.id.btn_text_position_route: // 文字位置
                goIntent(TextActivity.class, "11");
                break;
            case R.id.btn_text_draw_route: // 按路径绘制
                goIntent(TextActivity.class, "12");
                break;
            case R.id.btn_my_font_route: // 自定义字体
                goIntent(TextActivity.class, "13");
                break;
        }
    }

    private void goIntent(Class cla, String flag) {
        Intent intent = new Intent(RouteAndTextActivity.this, cla);
        intent.putExtra("two", flag);
        startActivity(intent);
    }
}
